package com.itcs.trading.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.itcs.trading.model.UserCashinOpHis;

public interface UserCashinOpHisMapper {
    int deleteByPrimaryKey(Long cashinNo);

    int insert(UserCashinOpHis record);

    int insertSelective(UserCashinOpHis record);

    UserCashinOpHis selectByPrimaryKey(Long cashinNo);

    int updateByPrimaryKeySelective(UserCashinOpHis record);

    int updateByPrimaryKey(UserCashinOpHis record);

	/** 
	* @Title: findWithdrawals 
	* @Description: 提现记录列表
	* @param id
	* @param pageSize
	* @param pageIndex
	* @param 
	* @return List<Map<String,Object>>
	* @throws 
	*/
    @Select("select "
    		+ "b.user_id user_id,"
    		+ "b.agent_name agent_name,"
    		+ "b.agent_id_num agent_id_num,"
    		+ "b.mobile mobile,"
    		+ "a.cashin_no cashin_no,"
    		+ "a.cashin_amount cashin_amount,"
    		+ "a.cashin_fee cashin_fee,"
    		+ "a.cashin_act_amount cashin_act_amount,"
    		+ "a.cashin_cardno cashin_cardno,"
    		+ "a.cashin_time cashin_time,"
    		+ "a.old_balance old_balance,"
    		+ "a.now_balance now_balance,"
    		+ "a.cashin_state cashin_state,"
    		+ "a.remark remark "
    		+ "from user_cashin_op_jnl a,user_customer_info b "
    		+ "where a.user_id=b.user_id and b.user_id=#{userId} limit #{start},#{pageSize}")
	List<Map<String, Object>> findWithdrawals(@Param("userId")Long id, @Param("start")Integer start, @Param("pageSize")Integer pageIndex);
}